package com.atguigu.springcloud.controler;

import com.atguigu.springcloud.service.PaymentServiceFeign;
import com.guigu.springcloud.entities.CommonResult;
import com.guigu.springcloud.entities.Payment;
import feign.Param;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Date 2021/7/26 20:48
 * @Created by wangle
 * @Description
 */
@RestController
@Slf4j
public class OrderFeigncontroller {

    @Resource
    private PaymentServiceFeign  paymentServiceFeign;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentbyid(
            @PathVariable("id") Long id){
            return  paymentServiceFeign.getpayment(id);


    }


    @GetMapping(value = "/consumer/payment/feign/timeout")

    String paymentFeignTimeOut(){
        return paymentServiceFeign.paymentFeignTimeOut();

    }


}
